3.96 \(\int \frac {(a+b x)^2 (A+B x)}{x} \, dx\)

Optimal. Leaf size=40 \[ a^2 A \log (x)+2 a A b x+\frac {B (a+b x)^3}{3 b}+\frac {1}{2} A b^2 x^2 \]

[Out]

2*a*A*b*x+1/2*A*b^2*x^2+1/3*B*(b*x+a)^3/b+a^2*A*ln(x)

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {80, 43} \[ a^2 A \log (x)+2 a A b x+\frac {B (a+b x)^3}{3 b}+\frac {1}{2} A b^2 x^2 \]

Antiderivative was successfully verified.

[In]

Int[((a + b*x)^2*(A + B*x))/x,x]

[Out]

2*a*A*b*x + (A*b^2*x^2)/2 + (B*(a + b*x)^3)/(3*b) + a^2*A*Log[x]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 80

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(b*(c + d*x)
^(n + 1)*(e + f*x)^(p + 1))/(d*f*(n + p + 2)), x] + Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(
d*f*(n + p + 2)), Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2,
0]

Rubi steps

\begin {align*} \int \frac {(a+b x)^2 (A+B x)}{x} \, dx &=\frac {B (a+b x)^3}{3 b}+A \int \frac {(a+b x)^2}{x} \, dx\\ &=\frac {B (a+b x)^3}{3 b}+A \int \left (2 a b+\frac {a^2}{x}+b^2 x\right ) \, dx\\ &=2 a A b x+\frac {1}{2} A b^2 x^2+\frac {B (a+b x)^3}{3 b}+a^2 A \log (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 43, normalized size = 1.08 \[ a^2 A \log (x)+a^2 B x+a b x (2 A+B x)+\frac {1}{6} b^2 x^2 (3 A+2 B x) \]

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x)^2*(A + B*x))/x,x]

[Out]

a^2*B*x + a*b*x*(2*A + B*x) + (b^2*x^2*(3*A + 2*B*x))/6 + a^2*A*Log[x]

________________________________________________________________________________________

fricas [A]  time = 0.52, size = 46, normalized size = 1.15 \[ \frac {1}{3} \, B b^{2} x^{3} + A a^{2} \log \relax (x) + \frac {1}{2} \, {\left (2 \, B a b + A b^{2}\right )} x^{2} + {\left (B a^{2} + 2 \, A a b\right )} x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*(B*x+A)/x,x, algorithm="fricas")

[Out]

1/3*B*b^2*x^3 + A*a^2*log(x) + 1/2*(2*B*a*b + A*b^2)*x^2 + (B*a^2 + 2*A*a*b)*x

________________________________________________________________________________________

giac [A]  time = 1.35, size = 46, normalized size = 1.15 \[ \frac {1}{3} \, B b^{2} x^{3} + B a b x^{2} + \frac {1}{2} \, A b^{2} x^{2} + B a^{2} x + 2 \, A a b x + A a^{2} \log \left ({\left | x \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*(B*x+A)/x,x, algorithm="giac")

[Out]

1/3*B*b^2*x^3 + B*a*b*x^2 + 1/2*A*b^2*x^2 + B*a^2*x + 2*A*a*b*x + A*a^2*log(abs(x))

________________________________________________________________________________________

maple [A]  time = 0.00, size = 46, normalized size = 1.15 \[ \frac {B \,b^{2} x^{3}}{3}+\frac {A \,b^{2} x^{2}}{2}+B a b \,x^{2}+A \,a^{2} \ln \relax (x )+2 A a b x +B \,a^{2} x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)^2*(B*x+A)/x,x)

[Out]

1/3*B*b^2*x^3+1/2*A*b^2*x^2+B*x^2*a*b+2*a*A*b*x+a^2*B*x+a^2*A*ln(x)

________________________________________________________________________________________

maxima [A]  time = 1.05, size = 46, normalized size = 1.15 \[ \frac {1}{3} \, B b^{2} x^{3} + A a^{2} \log \relax (x) + \frac {1}{2} \, {\left (2 \, B a b + A b^{2}\right )} x^{2} + {\left (B a^{2} + 2 \, A a b\right )} x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*(B*x+A)/x,x, algorithm="maxima")

[Out]

1/3*B*b^2*x^3 + A*a^2*log(x) + 1/2*(2*B*a*b + A*b^2)*x^2 + (B*a^2 + 2*A*a*b)*x

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 45, normalized size = 1.12 \[ x^2\,\left (\frac {A\,b^2}{2}+B\,a\,b\right )+x\,\left (B\,a^2+2\,A\,b\,a\right )+\frac {B\,b^2\,x^3}{3}+A\,a^2\,\ln \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(a + b*x)^2)/x,x)

[Out]

x^2*((A*b^2)/2 + B*a*b) + x*(B*a^2 + 2*A*a*b) + (B*b^2*x^3)/3 + A*a^2*log(x)

________________________________________________________________________________________

sympy [A]  time = 0.16, size = 46, normalized size = 1.15 \[ A a^{2} \log {\relax (x )} + \frac {B b^{2} x^{3}}{3} + x^{2} \left (\frac {A b^{2}}{2} + B a b\right ) + x \left (2 A a b + B a^{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)**2*(B*x+A)/x,x)

[Out]

A*a**2*log(x) + B*b**2*x**3/3 + x**2*(A*b**2/2 + B*a*b) + x*(2*A*a*b + B*a**2)

________________________________________________________________________________________